package com.heima.wemedia.feign;

import com.heima.apis.wemedia.IWemediaClient;
import com.heima.model.common.dtos.ResponseResult;
import com.heima.wemedia.service.WmChannelService;
import com.heima.wemedia.service.WmSensitiveService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class WemediaClient implements IWemediaClient {


    @Autowired
    private WmChannelService wmChannelService;

    @Autowired
    private WmSensitiveService wmSensitiveService;

    /**
     * 查询频道列表
     * @return
     */
    @Override
    @GetMapping("/api/v1/channel/list")
    public ResponseResult getChannels() {
        return wmChannelService.findAll();
    }

    /**
     * 查询所有敏感词
     * @return
     */
    @Override
    @GetMapping("//api/v1/sensitive/list")
    public ResponseResult getWmSensitives() {
        return wmSensitiveService.findList();
    }
}
